<div class="row mt-2">
    <div class="col-12">
        <form>
            <div class="form-row mb-2">
                <input type="hidden" name="page" value="<?php echo $indexInput->page; ?>">
                <div class="form-group col-2">
                    <label for="name">名称</label>
                    <input type="text" class="form-control" id="name" name="name" placeholder="班级名称" value="<?php echo $indexInput->name; ?>">
                </div>
                <div class="form-group col-6">
                    <label for="entranceDateBegin">入学日期</label>
                    <div class="row">
                        <div class="col-5">
                            <input type="date" value="<?php echo $indexInput->entranceDateBegin; ?>" name="entranceDateBegin" id="entranceDateBegin" class="form-control">
                        </div>
                        <div class="col-1 text-center col-form-label">
                              至
                        </div>
                        <div class="col-5">
                            <input class="form-control" value="<?php echo $indexInput->entranceDateEnd; ?>"  name="entranceDateEnd" type="date">
                        </div>
                    </div>
                </div>
                <div class="form-group col-2">
                    <label for="userName">班主任</label>
                    <input type="text" id="userName" name="userName" value="<?php echo $indexInput->userName; ?>" class="form-control">
                </div>
                <div class="form-group col-2 align-self-end">
                     <button class="btn btn-info">查询</button>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="row mt-1">
    <div class="col-12 text-right">
        <a class="btn btn-primary" href="<?php echo url('add'); ?>">新增</a>
    </div>
</div>
<div class="row mt-1">
    <div class="col-12">
        <table class="table">
            <thead>
                <tr>
                    <th>序号</th>
                    <th>名称</th>
                    <th>入学日期</th>
                    <th>创建时间</th>
                    <th>班主任</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <?php 
                    foreach($page->content as $key => $clazz) :
                ?>
                    <tr>
                        <td><?php echo $key + 1; ?></td>
                        <td><?php echo $clazz->name; ?></td>
                        <td><?php echo $clazz->entranceDate; ?></td>
                        <td><?php echo $clazz->createTime; ?></td>
                        <td><?php echo $clazz->user->name; ?></td>
                        <td>
                            <a class="btn btn-sm  btn-outline-primary" 
                            href="<?php echo url('edit?id=' . $clazz->id); ?>">编辑</a>
                            <a class="btn btn-sm  btn-outline-danger">删除</a>
                            <a class="btn btn-sm  btn-outline-success" href="<?php echo url('view?id=' . $clazz->id); ?>">查看详情</a>
                        </td>
                    </tr>
                <?php
                    endforeach;
                ?>
            </tbody>
        </table>
        <div class="row">
            <div class="col-8 offset-4">
                <?php echo $paginationComponent->render($page->totalPage); ?>
            </div>
        </div>
    </div>
</div>
